package com.work.mvc.view.panels.reports;

import com.vaadin.ui.*;
import com.work.constants.view.ComponentsSize;
import com.work.i18n.Messages;
import com.work.reports.ReportType;

public class TotalOvertimeReportPanel extends ReportPanel {
	
	private static final long serialVersionUID = 1056799681904491800L;
	
	private static ReportType reportType = ReportType.TOTAL_WORKED_OVERTIME;

	private HorizontalLayout content;

	public TotalOvertimeReportPanel() {
		super("Raport nadgodzin w danym okresie czasowym");
	}
	
	private ComboBox companyCombobox;
	private ComboBox yearCombobox;
	private ComboBox monthCombobox;
	
	@Override
	protected Component createContent()
	{
		content = new HorizontalLayout();
		
		companyCombobox = new ComboBox();
		yearCombobox = new ComboBox();
		monthCombobox = new ComboBox();
		
		companyCombobox.setCaption(Messages.get("firma"));
		yearCombobox.setCaption(Messages.get("rok"));
		monthCombobox.setCaption(Messages.get("miesiac"));
		
		content.addComponent(companyCombobox);
		content.addComponent(yearCombobox);
		content.addComponent(monthCombobox);
		
		content.setComponentAlignment(companyCombobox, Alignment.MIDDLE_RIGHT);
		content.setComponentAlignment(yearCombobox, Alignment.MIDDLE_CENTER);
		content.setComponentAlignment(monthCombobox, Alignment.MIDDLE_LEFT);
		
		content.setHeight("100%");
		content.setWidth(ComponentsSize.FULL);
		
		return content;
	}

	@Override
	protected ReportType getReportType()
	{
		return reportType;
	}
	
	@Override
	protected boolean isValid()
	{
		return true;
	}
}
